package com.amkai.aes.webservice.binary.objecthandler.casehistory;

import java.io.Serializable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.amkai.aes.aescommon.service.binary.job.casehistory.CDMImporterJob;
import com.amkai.aes.aescommon.service.binary.job.casehistory.CaseHistoryJobResult;
import com.amkai.aes.server.casehistory.CDMImporterProvider;
import com.amkai.aes.webservice.binary.JobObjectHandler;

public class CDMImporterHandler implements JobObjectHandler<CDMImporterJob, Serializable, CaseHistoryJobResult> {

	private static final Log log = LogFactory.getLog(CDMImporterHandler.class);

	@SuppressWarnings("unchecked")
	@Override
	public CaseHistoryJobResult process(CDMImporterJob job, Serializable object) throws Exception {
		try {
			CDMImporterProvider provider = new CDMImporterProvider();
			return provider.processJob(job, object);
		} catch (Exception e) {
			log.error("Case History Importer - Import AC Outputs", e);
			e.printStackTrace();
			throw e;
		}
	}

}
